package com.thinkingcoder.tccache.core.command.string;

import static com.thinkingcoder.tccache.constant.CommandConstants.StringCmd.MGET;

import com.thinkingcoder.tccache.core.command.Command;
import com.thinkingcoder.tccache.core.model.Reply;
import com.thinkingcoder.tccache.core.TcCache;

/**
 * MGET command.
 */
public class MGetCmd implements Command {
    @Override
    public String name() {
        return MGET;
    }

    @Override
    public Reply<?> exec(TcCache cache, String[] args) {
        String[] keys = getKeys(args);
        return Reply.array(cache.mGet(keys));
    }

}
